package org.jhub1.system.xmpp.commands;

import org.jhub1.system.xmpp.proxy.ProcessorSession;

public class ElementLogout extends Element implements Executable {

	public ElementLogout() {
		this.name = "bye";
		this.description = "Terminates the session";
	}

	@Override
	public ReturnMessage executeCommand(RequestMessage msg) {
		ReturnMessage rm = new ReturnMessage(msg);
		ProcessorSession.killSession();
		rm.setExtStatus(ReturnMessage.SUCCEEDED);
		rm.setMessage("Session is inactive. Goodbye.");
		return rm;
	} 
}
